<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,maximum-scale=1.0, user-scalable=no">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp">
    <script src="../js/lib/mdui.min.js"></script>
    <script src="../js/lib/jquery-3.2.1.slim.min.js"></script>
    <script src="../js/lib/holder.min.js"></script>
    <script src="../js/lib/highlight.pack.js"></script>
    <script src="../js/lib/mustache.js"></script>
    <script src="../js/lib/jquery.media.js"></script>
    <script src="../js/docs.js"></script>
    <script src="../js/init.js"></script>
    <script src="../js/listfile.js"></script>
    <link rel="stylesheet" href="../css/mdui.min.css">
    <link rel="stylesheet" href="../css/github-gist.css">
    <link rel="stylesheet" href="../css/railscasts.css">
    <link rel="stylesheet" href="../css/docs.css">
    <link rel="stylesheet" href="../css/mdui.min.css"/>
    <title>欢迎使用STdisk - 集中管理您的所有文件</title>
    <script>
        let data = {
            buttons: [
                {
                    color: "blue",
                    content: "取消分享",
                    icon: "delete",
                    event: "onclick='cancelshare()'"
                }
            ]
        };
        function load_file_elements() {
            let div = $("#file-elements");
            $.ajax({
                url: api + "/api/getpublicfile",
                dataType: 'json',
                type: 'GET',
                success: function (data) {
                    let code = data.code;
                    switch (code) {
                        case 0:
                            div.html("");
                            let array = data.items;
                            for (let i = 0; i < array.length; i++) {
                                load_file_item(array[i], div);
                            }
                            break;
                        case -1:
                            mdui.snackbar({
                                message: '未知错误' + data.message,
                            });
                            break;
                        case 403:
                            nologin();
                            break;
                    }
                }
            });
        }
        window.onload = function () {
            initfab(data);
            load_file_elements();
        };

    </script>
</head>

<body class=" mdui-drawer-body-left mdui-appbar-with-toolbar mdui-theme-accent-pink mdui-loaded mdui-theme-primary-blue">

<div class="mdui-appbar mdui-appbar-fixed">
    <div class="mdui-toolbar mdui-color-theme">
        <a href="javascript:" class="mdui-btn mdui-btn-icon" mdui-drawer="{target: '#main-drawer'}"><i
                class="mdui-icon material-icons">menu</i></a>
        <a href="../index.html" class="mdui-typo-headline">STdisk</a>
        <div class="mdui-toolbar-spacer"></div>
        <span class="mdui-btn mdui-btn-icon mdui-ripple mdui-ripple-white" mdui-dialog="{target: '#dialog-docs-theme'}"
              mdui-tooltip="{content: '设置主题'}"><i class="mdui-icon material-icons">color_lens</i></span>
        <a id="logout" class="mdui-btn mdui-btn-icon" mdui-tooltip="{content: '登出'}"><i
                class="mdui-icon material-icons">call_missed</i></a>
    </div>
</div>
<div class="mdui-drawer" id="main-drawer">

    <ul class="mdui-list" id="choosePage">
        <li class="mdui-list-item mdui-ripple">
            <div class="mdui-list-item-content">我的资料</div>
            <i class="mdui-icon material-icons">person</i>
        </li>
        <div class="mdui-divider"></div>
        <li class="mdui-list-item mdui-ripple ">
            <div class="mdui-list-item-content">我的网络硬盘</div>
            <i class="mdui-icon material-icons">insert_drive_file</i>
        </li>
        <li class="mdui-list-item mdui-ripple mdui-list-item-active">
            <div class="mdui-list-item-content">我的共享</div>
            <i class="mdui-icon material-icons">share</i>
        </li>
        <li class="mdui-list-item mdui-ripple">
            <div class="mdui-list-item-content">最近文件</div>
            <i class="mdui-icon material-icons">history</i>
        </li>
        <div class="mdui-divider"></div>
        <li class="mdui-list-item mdui-ripple">
            <div class="mdui-list-item-content">回收站</div>
            <i class="mdui-list-item-icon mdui-icon material-icons">delete</i>
        </li>
    </ul>
</div>

<div class="mdui-container doc-container mdui-p-t-4">
    <div class="mdui-row">
        <div class="mdui-card">
            <ul id="file-elements" class="mdui-list mdui-p-a-0" mdui-collapse="{accordion: true}">
            </ul>
        </div>
    </div>
</div>


</body>

</html>
